<?php
/**
 * Created by PhpStorm.
 * User: 氓羽
 * Date: 2018-5-1
 * Time: 16:32
 */
function smarty_block_teststr($parmas, $content){
    $replace = $parmas['replace'];
    $maxnum = $parmas['maxnum'];
    if($replace == 'true'){
        $content = str_replace('，',',', $content);
        $content = str_replace('。','.', $content);
    }
    $content = substr($content, 0 ,$maxnum);

    return $content;
}